import 'package:flutter/material.dart';

void main() => runApp(new HomePageStatelessWidget());

class HomePageStatelessWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return new HomePageStatefulWidget();
  }
}

class HomePageStatefulWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return new HomePageState();
  }
}

class HomePageState extends State {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: "主页面",
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Scaffold(
        body: SafeArea(
            child: Padding(
                padding: EdgeInsets.only(left: 10, right: 10, top: 20),
                child: Column(
                  children: <Widget>[
                    Container(
                      alignment: Alignment.center,
                      padding: EdgeInsets.all(5),
                      height: 35,
                      decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(20),
                          color: Color(0xfff5f6fa)),
                      child: TextField(
                        decoration: InputDecoration(border:InputBorder.none, icon: Icon(Icons.search)),
                      ),
                    ),
                    Padding(
                      padding: EdgeInsets.only(top: 10),
                      child: Image.asset('images/icon_banner.png'),
                    ),
                    Padding(padding: EdgeInsets.only(top: 10),
                    child: DefaultTabController(
                      length: 6,
                      child: Column(
                        children: <Widget>[
                          Container(
                            child: TabBar(
                              indicator: const BoxDecoration(),
                              labelColor: Color(0xff303133),
                              unselectedLabelColor: Color(0xffACACAD),
                              indicatorWeight: 1,
                              isScrollable: true,
                              labelStyle: TextStyle(fontSize: 18),
                              unselectedLabelStyle: TextStyle(fontSize: 15),
                              tabs: <Widget>[
                                Tab(text: '视频'),
                                Tab(text: '小说'),
                                Tab(text: '音乐'),
                                Tab(text: '动漫'),
                                Tab(text: '工具'),
                                Tab(text: '其他'),
                              ],
                            ),
                          )
                        ],
                      ),
                    ) ,)

                  ],
                ))),
      ),
    );
  }
}
